package weaver.workflow.cms.xiao.schedule;


import weaver.formmode.setup.ModeRightInfo;
import weaver.integration.mail.MailOperation;

import java.util.List;

/**
 * @author XiaoBokang
 * @create 2021/10/9 17:46
 */

public class VendorSyncTheard implements Runnable{

    private Integer userId;
    private Integer modelId;
    private ModeRightInfo mri;
    private List<Integer> mainIds;

    public VendorSyncTheard(int userId, int modelId, List<Integer> mainIds, ModeRightInfo mri){
        this.userId = userId;
        this.modelId = modelId;
        this.mainIds = mainIds;
        this.mri = mri;
    }

    @Override
    public void run() {
        for (Integer mainId : mainIds) {
            long l4 = System.currentTimeMillis();
            mri.rebuildModeDataShareByEdit(userId,modelId,mainId);
            mri.setNewRight(true);
            mri.editModeDataShare(userId,modelId,mainId);//新建时添加共享
            long l5 = System.currentTimeMillis();
            System.out.println("执行权限耗费时间: " + (l5 - l4));
        }
    }
}
